import dayjs from 'dayjs'

export const FormatDate = (dateStr) => {
  const time = dayjs(dateStr)
  return time.isValid() ? time.format('YYYY-MM-DD') : ''
}
export const FormatDateTime = (dateStr) => {
  const time = dayjs(dateStr)
  return time.isValid() ? time.format('YYYY-MM-DD HH:mm') : ''
}
export const FormatTime = (dateStr) => {
  const time = dayjs(dateStr)
  return time.isValid() ? time.format('HH:mm') : ''
}
